<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>导航栏</title>

<style>
body {
    margin: 0;
}

ul {
    list-style-type: none;
    margin: 5px;
    padding: 5px;
    width: 25%;
    background-color: white;

    height:600PX;

}

li a {
    display: block;
    color: seagreen;
    padding:10px 20px;
    text-decoration: none;
}

li a.active {  margin: 5px;
    padding: 5px;
    background-color: seagreen;
    color: white;
}

li a:hover:not(.active) {  margin: -2px;
    padding: -2px;
    background-color: #369e0c;
    color: white;
}
li a.xx{
      margin: 5px;
    padding: 5px;
    background-color: chartreuse;
           color: black;}
</style>
</head>
<body>

<ul>
  <li><a class="active" href="#home">首页</a></li>
  <li><a class="xx" href="#news">一级项目</a> </li>
  <li><a class="xx"  href="#contact">二级项目</a></li>
  <li><a class="xx" href="#about">三级项目</a></li>
</ul>



</body>
</html>
